How to use power function to do exponentiation in Python